package com.atguigu.gmall.product.service.impl;

import com.atguigu.gmall.model.product.SpuSaleAttr;
import com.atguigu.gmall.product.mapper.SpuSaleAttrMapper;
import com.atguigu.gmall.product.service.SpuSaleAttrService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author lsj
 * @create 2021-08-10 10:26
 */
@Service
public class SpuSaleAttrServiceImpl extends ServiceImpl<SpuSaleAttrMapper, SpuSaleAttr> implements SpuSaleAttrService {

    @Autowired
    SpuSaleAttrMapper spuSaleAttrMapper;

    /**
     * 按照spuId查出对应所有销售属性名和值
     * @param spuId
     * @return
     */
    @Override
    public List<SpuSaleAttr> getSpuAttrAndValue(Long spuId) {

        return spuSaleAttrMapper.getSpuAttrAndValue(spuId);
    }
}
